/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "节点/节点.h"
#include "节点/输入输出节点.h"




class API_EXPORT C_并行节点 : public C_节点基类 {
	std::vector<C_节点基类*> m_InNodes;
	std::vector<C_节点基类*> m_OutNudes;

	//std::string m_常量声明类型;
	std::string m_常量名称;
	//std::string m_常量定义;

	S_GPU参数槽		m_参数;

	
public:
	C_并行节点(S_设备环境& ctx, C_节点树* link_tree);
	~C_并行节点();

	//S_GPU计算*	m_GPU计算;

	S_Props		m_编译运行;
	S_Props		m_本地多维线程数量;
	S_Props		m_本地线程数量;
	S_Props		m_本地线程使用多维;

	bool		f_update();
	std::string DEF_节点编译函数;
	//void		f_异步解算();
	//void		f_重新绑定程序集(uint64 函数指针);
	//void		f_清除程序集();


	void			f_读取(FILE* f);
	void			f_写入(FILE* f);

	//S_物体* f_get虚拟体();
	//void	f_入回收();
	//void	f_回收();

	void    f_Copy(const C_节点基类* node);
protected:
	bool		m_是否链接;

};

C_节点基类* f_node_创建并行节点(S_设备环境& ctx, C_节点树* 子节点树);
C_节点基类* f_node_加载并行节点(S_设备环境& ctx, FILE* f);
void		f_node_保存并行节点(C_节点基类* n, FILE* f);





class API_EXPORT C_线程ID节点 : public C_节点基类 {
	
public:
	C_线程ID节点(S_设备环境& ctx);
	~C_线程ID节点();

	//S_Props		m_编译运行;

	std::string DEF_节点编译函数;
	
	void			f_读取(FILE* f);
	void			f_写入(FILE* f);

	//S_物体* f_get虚拟体();
	//void	f_入回收();
	//void	f_回收();

};

C_节点基类* f_node_创建线程ID节点(S_设备环境& ctx, C_节点树* 子节点树);
C_节点基类* f_node_加载线程ID节点(S_设备环境& ctx, FILE* f);
void		f_node_保存线程ID节点(C_节点基类* n, FILE* f);





